package com.itheima.io.bufferedwriter.demo01;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * 使用BufferedWriter写数据
 */
public class BufferedWriterDemo01 {

    public static void main(String[] args) throws IOException {

        // 1. 创建BufferedWriter对象
        /**
         *  public BufferedWriter​(Writer out)          使用默认大小的缓冲区去创建BufferedWriter​对象
         *  public BufferedWriter​(Writer out,int sz)   使用指定大小的缓存区去创建BufferedWriter​对象
         */
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("itheima-io-bufferedwriter\\a.txt")) ;

        // 2. 调用方法写数据
        bufferedWriter.write("哈哈, IO流学完了....快毕业了...");

        // 3. 释放资源
        bufferedWriter.close();

    }
}
